package com.xiaoke.service.impl;

import com.xiaoke.entity.Category;
import com.xiaoke.mapper.CategoryMapper;
import com.xiaoke.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public Category findById(Integer id) {
        return categoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Category> findBrotherCategory(Integer parentId, Integer currentId) {
        return categoryMapper.findBrotherCategory(parentId,currentId);
    }

    @Override
    public List<Category> findByParentId(Integer parentId) {
        return categoryMapper.findByParentId(parentId);
    }

    @Override
    public List<Category> findListByShop(String shopId) {
        return categoryMapper.findListByShop(shopId);
    }
}
